<template>
  <div style="width: 50%">
    <div class="card" style="padding: 30px">
      <el-form label-width="100px" style="padding-right: 50px">
        <el-form-item label="原密码">
          <el-input v-model="password" show-password />
        </el-form-item>
        <el-form-item label="新密码">
          <el-input v-model="newPassword" show-password />
        </el-form-item>
        <el-form-item label="确认新密码">
          <el-input v-model="confirmPassword" show-password />
        </el-form-item>
        <div style="text-align: center">
          <el-button type="primary" v-on:click="handleSave">保存</el-button>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      password: '',
      newPassword: '',
      confirmPassword: ''
    };
  },
  methods: {
    handleSave() {
      this.$message.error('功能待开发中');
      // if (this.user.newPassword !== this.user.confirmPasword) {
      //   this.$message.error('确认新密码错误');
      //   return;
      // }
      // request.put('/updatePassword', this.user).then(res => {
      //   if (res.code === '200') {
      //     this.$message.success('修改密码成功');
      //     // 清空缓存
      //     localStorage.removeItem('system-user');
      //     router.push('/login');
      //   } else {
      //     this.$message.error(res.msg);
      //   }
      // });
    },
  },
};
</script>